package io;

import java.io.*;

public class OOSDemo implements Serializable {
    public static void main(String[] args) throws IOException {
        String name = "刘桑";
        int age = 55;
        String gender = "男";
        String[] otherInfo = {"好好"};
        Person p = new Person(name,age,gender,otherInfo);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(p);
        oos.close();
        System.out.println("写完");
        System.out.println();

    }
}
